<?php
include "../../db_const.php";
include "../../connect.php";
include "../../connect_ado.php";
include "../../isa-lib/isa-function/isa_public_function.php";

//*****************************************************************************************************************
//	V1.0	HIENMT	Kiem tra so CMND da ton tai chua
//*****************************************************************************************************************
	$cmnd = $_REQUEST['id'];
	$type   = $_REQUEST['type'];

	$sql = "SELECT count(*) FROM T_ONEGATE_RECORD WHERE dbo.f_GetValueOfXMLtag(C_RECEIVED_RECORD_XML_DATA, 'cmnd') like '".$cmnd."' AND FK_RECORDTYPE like '".$type."' and C_CURRENT_STATUS IN ('CAP_PHEP')";
	$v_result = $ado_conn->GetRow($sql);
//	echo $sql.'/';
	echo($v_result[0]);
?>